{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sub = pd.read_csv('sample submission.csv')\n",
    "sub1 = pd.read_csv('Baseline_v1d.csv')\n",
    "sub2 = pd.read_csv('MH20_FastAI_v1a.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.160572</td>\n",
       "      <td>0.193437</td>\n",
       "      <td>0.206235</td>\n",
       "      <td>0.192433</td>\n",
       "      <td>0.081811</td>\n",
       "      <td>0.165512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.036995</td>\n",
       "      <td>0.047352</td>\n",
       "      <td>0.035089</td>\n",
       "      <td>0.060914</td>\n",
       "      <td>0.049451</td>\n",
       "      <td>0.045607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.072570</td>\n",
       "      <td>0.080711</td>\n",
       "      <td>0.081848</td>\n",
       "      <td>0.057456</td>\n",
       "      <td>0.021613</td>\n",
       "      <td>0.061616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.133344</td>\n",
       "      <td>0.157819</td>\n",
       "      <td>0.182063</td>\n",
       "      <td>0.146651</td>\n",
       "      <td>0.044024</td>\n",
       "      <td>0.135936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.158200</td>\n",
       "      <td>0.192802</td>\n",
       "      <td>0.204771</td>\n",
       "      <td>0.185580</td>\n",
       "      <td>0.066952</td>\n",
       "      <td>0.158288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.182946</td>\n",
       "      <td>0.228831</td>\n",
       "      <td>0.230120</td>\n",
       "      <td>0.230506</td>\n",
       "      <td>0.107168</td>\n",
       "      <td>0.190297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>0.302119</td>\n",
       "      <td>0.366882</td>\n",
       "      <td>0.324938</td>\n",
       "      <td>0.431883</td>\n",
       "      <td>0.364492</td>\n",
       "      <td>0.379807</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 0            1            2            3            4  \\\n",
       "count  1267.000000  1267.000000  1267.000000  1267.000000  1267.000000   \n",
       "mean      0.160572     0.193437     0.206235     0.192433     0.081811   \n",
       "std       0.036995     0.047352     0.035089     0.060914     0.049451   \n",
       "min       0.072570     0.080711     0.081848     0.057456     0.021613   \n",
       "25%       0.133344     0.157819     0.182063     0.146651     0.044024   \n",
       "50%       0.158200     0.192802     0.204771     0.185580     0.066952   \n",
       "75%       0.182946     0.228831     0.230120     0.230506     0.107168   \n",
       "max       0.302119     0.366882     0.324938     0.431883     0.364492   \n",
       "\n",
       "                 5  \n",
       "count  1267.000000  \n",
       "mean      0.165512  \n",
       "std       0.045607  \n",
       "min       0.061616  \n",
       "25%       0.135936  \n",
       "50%       0.158288  \n",
       "75%       0.190297  \n",
       "max       0.379807  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub1.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.154710</td>\n",
       "      <td>0.167917</td>\n",
       "      <td>0.224634</td>\n",
       "      <td>0.219698</td>\n",
       "      <td>0.064371</td>\n",
       "      <td>0.168670</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.072234</td>\n",
       "      <td>0.069655</td>\n",
       "      <td>0.047047</td>\n",
       "      <td>0.093708</td>\n",
       "      <td>0.071262</td>\n",
       "      <td>0.093366</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.018618</td>\n",
       "      <td>0.032466</td>\n",
       "      <td>0.051385</td>\n",
       "      <td>0.011541</td>\n",
       "      <td>0.002232</td>\n",
       "      <td>0.010246</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.098151</td>\n",
       "      <td>0.110249</td>\n",
       "      <td>0.194325</td>\n",
       "      <td>0.146127</td>\n",
       "      <td>0.018069</td>\n",
       "      <td>0.099320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.143973</td>\n",
       "      <td>0.161916</td>\n",
       "      <td>0.225135</td>\n",
       "      <td>0.209276</td>\n",
       "      <td>0.039370</td>\n",
       "      <td>0.152884</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.197863</td>\n",
       "      <td>0.219281</td>\n",
       "      <td>0.255865</td>\n",
       "      <td>0.293837</td>\n",
       "      <td>0.084269</td>\n",
       "      <td>0.229666</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>0.397343</td>\n",
       "      <td>0.370256</td>\n",
       "      <td>0.370951</td>\n",
       "      <td>0.465044</td>\n",
       "      <td>0.640687</td>\n",
       "      <td>0.659271</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 0            1            2            3            4  \\\n",
       "count  1267.000000  1267.000000  1267.000000  1267.000000  1267.000000   \n",
       "mean      0.154710     0.167917     0.224634     0.219698     0.064371   \n",
       "std       0.072234     0.069655     0.047047     0.093708     0.071262   \n",
       "min       0.018618     0.032466     0.051385     0.011541     0.002232   \n",
       "25%       0.098151     0.110249     0.194325     0.146127     0.018069   \n",
       "50%       0.143973     0.161916     0.225135     0.209276     0.039370   \n",
       "75%       0.197863     0.219281     0.255865     0.293837     0.084269   \n",
       "max       0.397343     0.370256     0.370951     0.465044     0.640687   \n",
       "\n",
       "                 5  \n",
       "count  1267.000000  \n",
       "mean      0.168670  \n",
       "std       0.093366  \n",
       "min       0.010246  \n",
       "25%       0.099320  \n",
       "50%       0.152884  \n",
       "75%       0.229666  \n",
       "max       0.659271  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub2.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "      <td>1267.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.156938</td>\n",
       "      <td>0.177615</td>\n",
       "      <td>0.217642</td>\n",
       "      <td>0.209337</td>\n",
       "      <td>0.070998</td>\n",
       "      <td>0.167470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.052361</td>\n",
       "      <td>0.054782</td>\n",
       "      <td>0.035406</td>\n",
       "      <td>0.074571</td>\n",
       "      <td>0.055545</td>\n",
       "      <td>0.066515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.048296</td>\n",
       "      <td>0.055076</td>\n",
       "      <td>0.101823</td>\n",
       "      <td>0.043788</td>\n",
       "      <td>0.010084</td>\n",
       "      <td>0.039790</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.115913</td>\n",
       "      <td>0.134304</td>\n",
       "      <td>0.193650</td>\n",
       "      <td>0.151764</td>\n",
       "      <td>0.030837</td>\n",
       "      <td>0.117157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.150391</td>\n",
       "      <td>0.176345</td>\n",
       "      <td>0.217057</td>\n",
       "      <td>0.199120</td>\n",
       "      <td>0.055903</td>\n",
       "      <td>0.159922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.189857</td>\n",
       "      <td>0.219463</td>\n",
       "      <td>0.241903</td>\n",
       "      <td>0.265003</td>\n",
       "      <td>0.091130</td>\n",
       "      <td>0.210577</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>0.329516</td>\n",
       "      <td>0.343181</td>\n",
       "      <td>0.316466</td>\n",
       "      <td>0.417043</td>\n",
       "      <td>0.468230</td>\n",
       "      <td>0.445366</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 0            1            2            3            4  \\\n",
       "count  1267.000000  1267.000000  1267.000000  1267.000000  1267.000000   \n",
       "mean      0.156938     0.177615     0.217642     0.209337     0.070998   \n",
       "std       0.052361     0.054782     0.035406     0.074571     0.055545   \n",
       "min       0.048296     0.055076     0.101823     0.043788     0.010084   \n",
       "25%       0.115913     0.134304     0.193650     0.151764     0.030837   \n",
       "50%       0.150391     0.176345     0.217057     0.199120     0.055903   \n",
       "75%       0.189857     0.219463     0.241903     0.265003     0.091130   \n",
       "max       0.329516     0.343181     0.316466     0.417043     0.468230   \n",
       "\n",
       "                 5  \n",
       "count  1267.000000  \n",
       "mean      0.167470  \n",
       "std       0.066515  \n",
       "min       0.039790  \n",
       "25%       0.117157  \n",
       "50%       0.159922  \n",
       "75%       0.210577  \n",
       "max       0.445366  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for i in sub.columns:\n",
    "    sub[i] = .38 * sub1[i] + .62 * sub2[i]\n",
    "\n",
    "sub.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sub.to_csv('Blend_v1f.csv', index = False)# 39/61 lb : 1.6709681834762957 --> Best\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
